<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>教职工界面</title>
    <!-- 引入element-ui样式 -->
    <link rel="stylesheet" href="../../plugins/element-ui/index.css">


    <style>
        .el-header {
            background-color: #B3C0D1;
            color: #333;
            line-height: 60px;
        }

        .el-aside {
            color: #333;
        }
    </style>

</head>
<body>
<div id="app">

    <el-container style="height: 700px; border: 1px solid #eee">

        <!--1.侧边菜单-->
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu >

                <el-submenu index="1">
                    <template slot="title"><i class="el-icon-s-custom"></i>个人信息</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="1-1" @click="clickUrl('a')">个人信息修改</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="2">
                    <template slot="title"><i class="el-icon-s-data"></i>项目|职称申请</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="2-1" @click="clickUrl('c')">项目申请</el-menu-item>
                        <el-menu-item index="2-2" @click="clickUrl('d')">职称申请</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="3">
                    <template slot="title"><i class="el-icon-s-home"></i>工作量</template>
                    <el-menu-item-group>
                        <template slot="title">个人</template>
                        <el-menu-item index="3-1-1" @click="clickUrl('e')">论文</el-menu-item>
                        <el-menu-item index="3-1-2" @click="clickUrl('f')">教改|科研</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group>
                        <template slot="title">教学</template>
                        <el-menu-item index="3-2-1" @click="clickUrl('g')">理论教学</el-menu-item>
                        <el-menu-item index="3-2-2" @click="clickUrl('h')">实践教学</el-menu-item>
                        <el-menu-item index="3-2-3" @click="clickUrl('i')">实验室工作量</el-menu-item>
                        <el-menu-item index="3-2-4" @click="clickUrl('j')">指导竞赛作量</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>

                <el-submenu index="4">
                    <template slot="title"><i class="el-icon-s-home"></i>工资奖金</template>
                    <el-menu-item-group>
                        <template slot="title">分组一</template>
                        <el-menu-item index="4-1" @click="clickUrl('k')">个人工资奖金查看</el-menu-item>
                    </el-menu-item-group>
                </el-submenu>


            </el-menu>
        </el-aside>

        <!--2.上边栏-->
        <el-container style=" text-align: right; font-size: 12px">
            <el-header style="text-align: right; font-size: 12px">
                <img style="width: 50px;height: 50px;border-radius: 40%;position: absolute;margin: 5px 0 0 -60px" :src="imageUrl">

                <el-dropdown>
                    <i class="el-icon-setting" style="margin-right: 15px"></i>
                    <el-dropdown-menu slot="dropdown">
                        <el-dropdown-item>
                            <p @click="clickUrl(1)">修改个人信息</p>
                        </el-dropdown-item>
                        <el-dropdown-item>
                            <p @click="loginOut(1)">退出账号</p>
                        </el-dropdown-item>
                    </el-dropdown-menu>
                </el-dropdown>

<!--                <span> 用户名称</span>-->
                <span> {{ teacherInfo.data.name }}</span>
            </el-header>

            <!--3.主内容(iframe)-->
            <el-main>
                <iframe
                        :src="iframeUrl"
                        frameborder="0"
                        name="iframe0"
                        width="100%"
                        height="100%"
                ></iframe>
            </el-main>
        </el-container>
    </el-container>

</div>


<script src="../../plugins/vue/vue.js"></script>

<!-- 引入element-ui组件库 -->
<script src="../../plugins/element-ui/index.js"></script>

<!-- 引入axios -->
<script src="../../plugins/axios/axios.min.js"></script>

<script>
    new Vue({
        el:'#app',    //elemente
        data:{
            infoName:'',  //标题
            teacherInfo:{}, //当前用户信息
            // iframeUrl:'list/adminSalaryList.html', //主内容的url
            iframeUrl:'teacherWelcome.html', //主内容的url

            imageUrl:'',
        },
        created() {
            const teacherInfo = window.localStorage.getItem('teacher')
            console.log("teacherInfo1:::"+teacherInfo)
            if (teacherInfo) {
                this.teacherInfo = JSON.parse(teacherInfo)
            }
            console.log("teacherInfo2:::"+teacherInfo)

            this. imageUrl=`/files/downloadFile?name=${this.teacherInfo.data.image}`

        },
        methods:{
            clickUrl(index){
                if (index=="a"){
                    this.infoName='个人信息修改'
                    this.iframeUrl='list/updateTeacherMyself.html'
                }else if (index=="b"){
                    this.infoName='科研论文教改申请'
                    this.iframeUrl='list/projectList.html'
                }else  if (index=="c"){
                    this.infoName='项目申请'
                    this.iframeUrl='list/projectList.html'
                }else if (index=="d"){
                    this.infoName='职称申请'
                    this.iframeUrl='list/ProfessionalList.html'
                }else  if (index=="e"){
                    this.infoName='论文'
                    this.iframeUrl='list/thesisList.html'
                }else if (index=="f"){
                    this.infoName='教改|科研'
                    this.iframeUrl='list/scientificList.html'
                }else if (index=="g"){
                    this.infoName='理论教学'
                    this.iframeUrl='list/theory.html'
                }else if (index=="h"){
                    this.infoName='实践教学'
                    this.iframeUrl='list/practice.html'
                }else if (index=="i"){
                    this.infoName='实验室工作量'
                    this.iframeUrl='list/scientificList.html'
                }else if (index=="j"){
                    this.infoName='指导竞赛作量'
                    this.iframeUrl='list/experiment.html'
                }else if (index=="k"){
                    this.infoName='个人工资奖金查看'
                    this.iframeUrl='list/salaryList.html'
                }
            },
            loginOut(){
                localStorage.setItem('teacher',null)
                window.location.href='../login/Login.html';
            }


        }

    })
</script>
</body>
</html>
